﻿using System;
using System.Linq;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using MahApps.Metro.Controls;
using Red.Controls.Extensions;
using Red.Core.Extensions;
using Red.EngineData.View;
using System.Windows.Media.Imaging;
using Red.Controls.Shell;
using System.Windows.Controls;

namespace Red.Controls
{
    /// <summary>
    /// Information displayed on error.
    /// </summary>
    public partial class PreviewErrorControl : UserControl
    {
        public PreviewErrorControl()
        {
            InitializeComponent();
        }

        public string ErrorTitle
        {
            get
            {
                return (string)ErrorTitleLabel.Content;
            }
            set
            {
                ErrorTitleLabel.Content = value;
            }
        }

        public string ErrorInfo
        {
            get
            {
                return ErrorInfoText.Text;
            }
            set
            {
                ErrorInfoText.Text = value;
            }
        }

        public string ErrorDetails
        {
            get;
            set;
        }

        private void MetroWindow_Initialized( object sender, EventArgs e )
        {
            Uri uri = new ResourceUri( "Icons/deadlogo.png" );
            ErrorImage.Source = new BitmapImage( uri );
        }

        private void Details_Click( object sender, RoutedEventArgs e )
        {
            RedMessageBox.Show( this, RedDialogType.Ok, ErrorDetails, "Error details" );
        }
    }

}
